<template>
  <el-form-item label="标签">
    <el-input v-model="currentItem.label" />
  </el-form-item>
</template>

<script setup lang="ts">
import { computed, PropType } from "vue";
import { DraggableTreeNode } from "../../../type";

const props = defineProps({
  currentItem: {
    type: Object as PropType<DraggableTreeNode>,
    default: () => {
      return {};
    },
  },
});
// const componentProps = computed({
//   get() {
//     return props.currentItem?.component?.componentProps || {};
//   },
//   set(value) {
//     if (props.currentItem?.component) {
//       props.currentItem.component.componentProps = value;
//     }
//   },
// });
const emit = defineEmits(["update:currentItem"]);
const currentItem = computed({
  get() {
    return (
      props.currentItem || {
        label: "",
        component: {},
      }
    );
  },
  set(value) {
    emit("update:currentItem", value);
  },
});
</script>

<style lang="scss" scoped></style>
